{erl_opts, [ debug_info
            ,{parse_transform, lager_transform}
            ,{lager_extra_sinks,[game]}
            ,{d,'TEST'}
           ]}.

{plugins, [{pbuf,{svn,"pbuf","0.0.1"}}
           ,{pc,{svn,"pc","1.11.0"}}
           ,{getopt,{svn,"getopt","1.0.1"}}
           ,{gpb,{svn,"gpb","4.11.1"}}
           ,{providers,{svn,"providers","1.8.1"}}
           ,{rebar3_gpb_plugin,{svn,"rebar3_gpb_plugin","2.13.1"}}
           ,{rebar3_eetcd_plugin,{svn,"rebar3_eetcd_plugin","0.3.0"}}
          ]}.

{deps, [{recon,{svn,"recon","2.5.1"}}
        ,{bson,{svn,"bson","0.2.2"}}
        ,{ranch,{svn,"ranch","1.7.1"}}
        ,{cowlib,{svn,"cowlib","2.8.0"}}
        ,{cowboy,{svn,"cowboy","2.7.0"}}
        ,{goldrush,{svn,"goldrush","0.1.9"}}
        ,{lager,{svn,"lager","3.9.2"}}
        ,{jsx,{svn,"jsx","2.10.0"}}
        ,{mysql,{svn,"mysql","1.6.0"}}
        ,{poolboy,{svn,"poolboy","1.5.2"}}
        ,{dbPool,{svn,"dbPool","0.1.2"}}
        ,{pbkdf2,{svn,"pbkdf2","2.0.1"}}
%        ,{prometheus,{svn,"prometheus","4.5.0"}}
        ,{mongodb,{svn,"mongodb","0.1.1"}}
        ,{eetcd,{svn,"eetcd","0.3.3"}}
        ,{gun,{svn,"gun","1.3.3"}}
        ,{service,{svn,"service","0.0.2"}}
         ,{crc32cer,{svn,"crc32cer","0.1.4"}}
         ,{brod,{svn,"brod","3.15.6"}}
         ,{kafka_protocol,{svn,"kafka_protocol","2.3.6"}}
         ,{snappyer,{svn,"snappyer","1.2.5"}}
         ,{supervisor3,{svn,"supervisor3","1.1.11"}}
        ,{brodc,{svn,"brodc","0.0.1"}}
        ,{meck,{svn,"meck","0.8.13"}}
        ,{observer_cli,{svn,"observer_cli","1.6.1"}}
       ]}.
{overrides,[{override,mongodb,[{plugins,[]}]}
            ,{override,rebar3_eetcd_plugin,[{deps,[]}]}
            ,{override,brod,[{plugins,[]}]}
            %,{override,prometheus,[{plugins,[]}]}
%            ,{override,lager,[{deps,[]}]}
%            ,{override,kafka_protocol,[{deps,[]}]}
%            ,{override,brodc,[{deps,[]}]}
%            ,{override,brod,[{deps,[]}]}
%
           ]}.

{relx, [{release, { gameServer, "0.1.0" },
         [
          sasl,
          lager,
          common,
          proto,
          config,
          database,
          gate,
          role,
          dbPool,
          mnesia,
          recon,
          observer,
          runtime_tools,
          brodc,
          brod,
%          swallow,
          web,
          jsx,
          order,
          service,
          behavior,
          regions,
          world,
          universe,
          %prometheus,
          bson,
          pbkdf2,
          eetcd,
          gun,
          gpb,
          getopt,
          battleGround
         ]},

        {sys_config, "config/sysconfig/sys.config"},
        {vm_args, "config/sysconfig/vm.args"},

        {dev_mode, true},
        {include_erts, false},

        {overlay,[{mkdir,"releases/script"}
                 ,{copy, "script/log_init.sql","releases/script/log_init.sql"}
                 ]},

        {extended_start_script, true}]
}.

{profiles, [{prod, [{relx, [{dev_mode, false},
                            {include_src, false},
                            {include_erts, true}
                           ]}
                    %% there should never use no_debug_info as hot_update use debug_info ...
                    %,{erl_opts,[debug_info
                    %            ,{i, "./_build/default/plugins/gpb/include"}
                    %            ,{parse_transform, lager_transform}
                    %            ,warnings_as_errors
                    %            ,{lager_extra_sinks,[game]}
                    %            ,{compile_info,[{compile_time,{erlang,localtime,[]}}
                    %                            ,{git_commit,{os,cmd,["git log --pretty=format:\"%H\" -1"]}}
                    %                           ]}
                    %           ]}
                    ,{overrides,[{del,[{erl_opts,[{d,'TEST'},{d,'FTEST'}]}]}
                                ,{add,[{erl_opts,[warnings_as_errors
                                                  ,{compile_info,[{compile_time,{erlang,localtime,[]}}
                                                                  ,{git_commit,{os,cmd,["git log --pretty=format:\"%H\" -1"]}}
                                                                 ]}
                                                 ]}
                                      ]}
                                ]}
                   ]}
            ,{test,[{deps,[{meck,{svn,"meck","0.8.13"}}]}
                   ]}
           ]
}.

{dist_node, [
    {setcookie, 'svr_cookie'},
    {name , 'game19@192.168.10.9'}
]}.